<?php
class Ext_Filter_OracleDate implements Zend_Filter_Interface
{
	private $_month = array(
		'01' => 'JAN',
		'02' => 'FEB',
		'03' => 'MAR',
		'04' => 'APR',
		'05' => 'MAY',
		'06' => 'JUN',
		'07' => 'JUL',
		'08' => 'AGO',
		'09' => 'SEP',
		'10' => 'OCT',
		'11' => 'NOV',
		'12' => 'DEC'
	);
    public function filter( $value )
    {
    	if( empty( $value )) {
    		return null;
    	}
		$dateExplode = explode( '-', $value );
		if( count( $dateExplode ) < 3 ) {
			$dateExplode = explode('/', $value );
		}
		
		return $dateExplode[2] . '-' . $this->_month[$dateExplode[1]] . '-' .  $dateExplode[0];
			
    }
}
